<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Files extends MY_Controller {

	
	public function index($file = NULL)
	{
		$this->load->model("files/files_model");
		
		$data_arr = $this->files_model->get_info_files($file);
		@Header("Content-type: application/octet-stream");
		@Header("Content-Disposition: attachment; filename=" . $file);  
		if(isset($data_arr->data))
		{
			echo base64_decode($data_arr->data);
		}
	}

	public function info($file = NULL)
	{
		$this->load->model("files/files_model");
		if($file == NULL)
		{
			return NULL;
		}
		$data_arr = $this->files_model->get_info_files($file);
		if($data_arr)
		{
			$this->view(200,$data_arr,"成功");
		}
		$this->view(304,NULL,"失败");
	}

	
}
